<!--
 * @Author: HeAo
 * @Date: 2021-10-08 15:06:55
 * @LastEditTime: 2021-10-08 16:46:47
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \web2103-2105\web2103code\3-2-Vue\day01\4-条件渲染.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>再见Vue</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.14/vue.js"></script>
</head>

<body>
  <div id="app">
    <div v-if="isLogin">登陆成功，欢迎你</div>
    <div v-else>请登录</div>
    <div>
      <button v-if="isLogin" @click="isLogin = false">退出</button>
      <button v-else @click="isLogin = true">登录</button>
    </div>
    <div>
      <button v-show="false" @click="isLogin = false">退出</button>
      <button v-show="true" @click="isLogin = true">登录</button>
    </div>
  </div>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        isLogin: false
      },
      methods: {
        findAllCategories() {
          console.log('查询所有栏目信息');
        }
      },
      created() {
        this.findAllCategories()
      }
    })
  </script>
</body>

</html>